<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
</body>
<script>
  var arr = [1, 3, 2, 44, 4, 8, 11, 5]

  for(var i = 0; i < arr.length; i++){
    for(var j = 0; j < arr.length - i; j++){
      if(arr[j] > arr[j + 1]){
        var temp = arr[j];
        arr[j] = arr[j + 1];
        arr[j + 1] = temp;
      }
    }
  }

  console.log(arr);
</script>
</html>